The present invention relates to a table recognition method and apparatus for converting a paper document having a table format into electronic table format data using OCR (Optical Character Recognition), and a storage medium.
Table recognition processing of converting a paper document having a table format into electronic data using OCR (Optical Character Recognition) makes it possible to form a database of information in a table on a paper sheet. This technology is important to widen the table utilization range.
Table recognition includes processing of analyzing the structure of a table and processing of recognizing characters in cells as elements of the table. A xe2x80x9ctablexe2x80x9d has a two-dimensional structure consisting of a series of rows and columns of xe2x80x9ccellsxe2x80x9d which have meaningful sets of characters and form elements of the table. From this viewpoint, table structure analysis is equivalent to an operation of obtaining the numbers of rows and columns of the table, the correspondences between characters in the table and the cells, and the correspondences between the cells and the matrix range of the table.
A general table recognition apparatus automatically analyzes the table structure, though the formats of tables to be recognized are limited. For example, only tables with easily detectable structures can be analyzed, including a table in which all cells are partitioned by ruled lines so the table structure can be readily obtained by only extracting the ruled lines, and a table in which ruled lines between the cells are not illustrated although cells are regularly laid out in a matrix and the structure can be easily estimated from the character layout.
However, tables take various layouts depending on the taste or intention of the user. Especially, when a table without ruled lines between cells has a mixture of cells across a plurality of rows and columns, blank cells, and a cell consisting of a plurality of rows, it is very difficult to always accurately obtain the structure from only the character layout. There are also examinations for realizing structure analysis close to the human thinking process by using models or taking the character recognition result into consideration. However, it may be impossible to always automatically analyze the structures of all tables.
A user of a table recognition apparatus corrects an automatically analyzed table structure as needed, thereby obtaining desired table data. The value of a table recognition apparatus greatly depends on the efficiency of the correction operation.
The present invention has been made in consideration of the above situation, and has as its object to provide an environment that allows easy correction of xe2x80x9ccellsxe2x80x9d in a table structure obtained as the result of automatic analysis and efficient correction of the table structure.
It is another object of the present invention to provide an environment that allows more efficient correction of a table structure by real-time display of a change in the table structure based on correction by the user.
In order to achieve the above objects, according to an aspect of the present invention, a table recognition apparatus has the following arrangement.
There is provided a table recognition apparatus comprising: analysis means for analyzing an area and position of each cell in a table on the basis of a layout state of ruled lines and character strings contained in an image of the table to obtain a table structure; table structure display means for displaying the table structure obtained by the analysis means; instruction means for instructing to correct the area of the cell in the table structure displayed by the display means; correction means for correcting the area and position of the cell on the basis of a correction instruction by the instruction means to obtain a corrected table structure; and generation means for recognizing characters in each cell of the corrected table structure and generating table format data on the basis of a recognition result and the table structure.
In order to achieve the above objects, according to another aspect of the present invention, a table recognition method has the following steps.
There is provided a table recognition method comprising: a code for the analysis step of analyzing an area and position of each cell in the table on the basis of a layout state of ruled lines and character strings contained in an image of the table to obtain a table structure; a code for the table structure display step of displaying the table structure obtained in the analysis step; a code for the instruction step of instructing to correct the area of the cell in the table structure displayed in the display step; a code for the correction step of correcting the area and position of the cell on the basis of a correction instruction in the instruction step to obtain a corrected table structure; and a code for the generation step of recognizing characters in each cell of the corrected table structure and generating the table format data on the basis of a recognition result and the table structure.